package pl.kamsoft.xml.ws.auth;

public class AuthProxy implements pl.kamsoft.xml.ws.auth.Auth_PortType {
  private String _endpoint = null;
  private pl.kamsoft.xml.ws.auth.Auth_PortType auth_PortType = null;
  
  public AuthProxy() {
    _initAuthProxy();
  }
  
  public AuthProxy(String endpoint) {
    _endpoint = endpoint;
    _initAuthProxy();
  }
  
  private void _initAuthProxy() {
    try {
      auth_PortType = (new pl.kamsoft.xml.ws.auth.Auth_ServiceLocator()).getAuth();
      if (auth_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)auth_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)auth_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (auth_PortType != null)
      ((javax.xml.rpc.Stub)auth_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public pl.kamsoft.xml.ws.auth.Auth_PortType getAuth_PortType() {
    if (auth_PortType == null)
      _initAuthProxy();
    return auth_PortType;
  }
  
  public void login(pl.kamsoft.xml.ws.kaas.login_types.LoginParam[] credentials, java.lang.String password, javax.xml.rpc.holders.StringHolder response, pl.kamsoft.xml.ws.common.holders.SessionHolder session, pl.kamsoft.xml.ws.common.holders.AuthTokenHolder token) throws java.rmi.RemoteException, pl.kamsoft.xml.ws.common.InputException, pl.kamsoft.xml.ws.common.PassExpiredException, pl.kamsoft.xml.ws.common.AuthTokenException, pl.kamsoft.xml.ws.common.AuthenticationException, pl.kamsoft.xml.ws.common.ServerException, pl.kamsoft.xml.ws.common.AuthorizationException{
    if (auth_PortType == null)
      _initAuthProxy();
    auth_PortType.login(credentials, password, response, session, token);
  }
  
  public java.lang.String logout(pl.kamsoft.xml.ws.common.Session session, pl.kamsoft.xml.ws.common.AuthToken token, java.lang.String request) throws java.rmi.RemoteException, pl.kamsoft.xml.ws.common.ServerException{
    if (auth_PortType == null)
      _initAuthProxy();
    return auth_PortType.logout(session, token, request);
  }
  
  public java.lang.String changePassword(pl.kamsoft.xml.ws.kaas.login_types.ChangePasswordParams request, pl.kamsoft.xml.ws.common.AuthToken token, pl.kamsoft.xml.ws.common.Session session) throws java.rmi.RemoteException, pl.kamsoft.xml.ws.common.SessionException, pl.kamsoft.xml.ws.common.InputException, pl.kamsoft.xml.ws.common.AuthTokenException, pl.kamsoft.xml.ws.common.ServerException, pl.kamsoft.xml.ws.common.AuthorizationException{
    if (auth_PortType == null)
      _initAuthProxy();
    return auth_PortType.changePassword(request, token, session);
  }
  
  public java.lang.String changePasswordLog(pl.kamsoft.xml.ws.kaas.login_types.LoginParam[] credentials, java.lang.String oldPassword, java.lang.String newPassword, java.lang.String newPasswordRepeat) throws java.rmi.RemoteException, pl.kamsoft.xml.ws.common.InputException, pl.kamsoft.xml.ws.common.AuthenticationException, pl.kamsoft.xml.ws.common.ServerException, pl.kamsoft.xml.ws.common.AuthorizationException{
    if (auth_PortType == null)
      _initAuthProxy();
    return auth_PortType.changePasswordLog(credentials, oldPassword, newPassword, newPasswordRepeat);
  }
  
  
}